﻿
namespace EmbeddedSharp.Scripting.Function.Flow {

    /// <summary>
    /// square(x):={return x*2;};
    /// echo(square(3));
    /// </summary>
    public class BlockNode : ContextFuncNode {

        public BlockNode()
            : base("block") {
        }

        public BlockNode(IContext context)
            : base("block", context) {
        }

        public override object Evaluate() {
            //StackFrame frame = new StackFrame();
            //base.Context.Push(frame);

            for (int index = Parameters.Count - 1; index >= 0; index--) {
                Parameters[index].Evaluate();
            }
            //base.Context.Pop();

            return string.Empty;
        }
    }
}
